<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let boolean=false;
        //在js里面 false==0  true==1,空的就为false ，不为空就为true
         console.log(0==boolean);//true
         console.log(1==true);

          let i=111;

         if(i){
             console.log("for循环执行了");
         }

         console.log(Boolean([]));//true
         console.log([]);//[],js里面的[]不是空，是有意义的
         console.log({});

         if({}){
             console.log("object生效");//生效了
         }
         if([]){
             console.log("数组生效");//生效了
         }

         if(000) {
            console.log("sb");
         }

         let num11=12;
         let num22=!num11;//true变为false
         let num222=!!num11;
         console.log( num22);//false
         console.log(num222);//true

         console.log(Boolean(12));

         console.log("________________");
         let array=[];
         console.log(!!array);
         console.log(Boolean(array));

         let obj={};
         console.log(!!obj);
         console.log(Boolean(obj));

         let date=new Date();
         console.log(date);
    </script>
</body>
</html>